home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-15 | 43.7 KB | 1,406 lines | [TEXT/MPS ] |
- //
- // Install Fat App.r
- //
- // This install script demonstrates the installation of an application that
- // can run on a Power Macintosh in Native Mode, a 68000 Macintosh, or both.
- //
- // The ability for an application to run under either a PowerMac or 68K machine
- // is referred to as a Fat Application. This decidely untechnical term refers
- // simply to the fact that the application contains more resources than are
- // needed to run on one platform or the other, and is larger than a version
- // of the same application that runs on only a single platform.
- //
- // The main purpose of this installer script is to allow for installation
- // of a Fat Application, or alternatively either the 68K only version, or
- // the PowerMac only version.
- //
- // This is easy to accomplish through Easy Install, as the scriptwriter
- // has complete control over what is going to be installed.
- //
- // What is not easy to accomplish is the creation of one package in Custom
- // Install, that will install the Fat Application, but has two sub-packages
- // that will install either the 68K only version or the PowerMac only version
- // if selected individually, but install the Fat Application if they are
- // both selected.
- //
- // The above described Custom Install scenario has been requested by
- // scriptwriters within Apple and by 3rd party developers as something
- // they would like to be able to do. The specific needs of your project
- // may differ. If the demands of the Custom Install scenario described do
- // not apply to your situation, then your install script may end up being
- // a lot simpler than this example.
- //
- // NOTE: Since the original creation of this script three changes have been
- // made. Installation of the PowerMac data fork is now accomplished via
- // InstaCompOne file compression, and the installation of 68K CODE resource
- // items is now accomplished via InstaCompOne resource compression. A 'vers'
- // resource item has been added to the resource fork of the archive containing
- // the data fork for the PowerMac.
- //
- // For simplicity of scripting, all files and resource items that can be
- // installed have been grouped into four categories:
- // 1) PowerMac specific stuff
- // 2) 68K specific stuff
- // 3) Common stuff ( used by either 68K or PowerMac )
- // 4) PowerMac Warning on 68K ( used by the PowerMac only version )
- //
- // From the applications 'ModApp.Fat' ( which can be found inside the folder
- // 'Sources:ModApp.FAT app:' ) and 'NotPPC' ( which can be found
- // inside the folder 'NotPPC:' ) four files have been created, each file
- // containing the items for one of the above described categories. These
- // four files will be used as the sources for installation.
- //
- // To create the four files described above:
- // 1) Start with a complete Fat Application
- // 2) Remove all CODE resources from the Fat Application
- // and put them in a new ResEdit file
- // 3) Save this ResEdit file as "68K Macintosh Part"
- // 4) Continue using the modified Fat Application
- // 5) Remove all remaining resources, except for the 'cfrg' item
- // and put them in a new ResEdit file
- // 6) Save this ResEdit file as "Common Part"
- // 7) Rename the modified Fat Application as "Power Macintosh Part" and
- // change it's type and creator to 'rsrc' and 'RSED'.
- // WARNING: The "Power Macintosh Part" must contain the data fork
- // of the original Fat Application, so don't just copy the
- // 'cfrg' resource item to a new ResEdit file and save it.
- // 8) Copy all the resources from "NotPPC" application
- // into a new ResEdit file.
- // 9) Save this ResEdit file as "PowerMacWarnOn68K Part"
- //
- // NOTE: All the above desribed steps can be accomplished in ResEdit
- // except for the renaming of a file. To rename a file, or create a copy
- // with another name, rename the file or copy from within the Finder. To
- // change the file type and creator, open the file within ResEdit and select
- // "Get Info for <filename>" from the File menu.
- //
- //
- // When installing one of the three basic scenarios ( PowerMac, 68K, Fat App )
- // install the following groups for each:
- // 1) 68K <= 68K specific stuff, Common stuff
- // 2) PowerMac <= PowerMac specific stuff, Common stuff, PowMac Warn on 68K
- // 3) Fat App <= PowerMac specific stuff, 68K specific stuff, Common stuff
- //
- // NOTE: Because of Custom Install design specs ( described earlier ), we have
- // to be a little tricky when designing the PowerMac package to be added to
- // Custom Install. It is necessary to include the "PowerMac Warn on 68K" module
- // in the PowerMac portion. But we don't know when the PowerMac portion is
- // selected from Custom Install whether it is part of a complete Fat App
- // installation or part of a PowerMac only installation.
- //
- //
- // Contents of each installation source file :
- //
- // 68K Macintosh Part
- // - 'CODE' (0) resource item // CODE for 68K app
- // - 'CODE' (1) resource item // CODE for 68K app
- // - 'CODE' (2) resource item // CODE for 68K app
- //
- // Power Macintosh Part
- // - data fork // CODE for PowerMac app
- // - 'cfrg' (0) resource item // describes data fork contents
- //
- // Common Part
- // - This file contains all the resources in the Fat App
- // except for the actual CODE to run the program on either
- // platform ( 68K or PowerMac ), and except for the 'cfrg'
- // resource item from the PowerMac portion.
- //
- // PowerMac Warning On 68K
- // - 'CODE' (0) resource item // 68K CODE for NotPPC alert
- // - 'CODE' (1) resource item // 68K CODE for NotPPC alert
- // - 'ALRT' (27309) resource item // rsrc's for NotPPC alert
- // - 'DITL' (27309) resource item // rsrc's for NotPPC alert
- // - 'STR ' (27309) resource item // rsrc's for NotPPC alert
- //
- // NOTE: In the PowerMac application, the CODE for the program is stored
- // in the DATA fork of the application. In the 68K application, the
- // CODE for the program is stored in resource items of type 'CODE'.
- // Because the PowerMac CODE is stored in the data fork, we must use
- // a file atom ( 'infa' ) to handle installation of the CODE to run
- // the program. Because the 68K CODE is stored in resources,
- // we can use resource atoms ( 'inra' ) to handle installation.
- //
- //
- // IMPORTANT: The 68K specific portion of the installation consists entirely
- // of five 'CODE' type resource items, numbered 0 to 4. The "PowerMac Warning
- // on 68K" portion of the installation contains among other things two 'CODE'
- // type resource items, numbered 0 to 1 ( the same CODE resources that
- // were created as the "NotPPC" code resource ). The sole purpose of the two
- // 'CODE' resource items within "PowerMac Warning on 68K" portion is to provide
- // an alert when the PowerMac only version of the application is launched on
- // a 68K system. This alert explains to the user that there's not much of a
- // chance that the application can run successfully on a 68K system. Special
- // care needs to be exercized so that the 68K specific 'CODE' resource items
- // are NEVER replaced by any of the PowerMac specific 'CODE' resource items.
- //
- // Now for the really interesting part. Because of the design spec for Custom
- // Install ( described earlier ), we must take different approaches to the
- // Custom Installation packages depending on whether or not the target
- // application already exists. Remember that we need to be careful when
- // installing "PowerMac Warning on 68K" CODE resource items, that these
- // resource items never overwrite the 68K CODE resource items.
- //
- // If the target application already exists we must use resource atoms
- // ( 'inra' ) to install the "PowerMac Warning on 68K" CODE resources.
- // The "keepExisting" flag provided with the resource atom ( 'inra' )
- // allows us to prevent resource items from replacing any existing resource
- // items of the same resource type and resource ID. This will prevent the
- // "PowerMac Warning on 68K" resource items from replacing 68K code resources.
- //
- // If the target application does not already exist we must use
- // ResMerge ( 'inrm' ) atoms to install the "PowerMac Warning on 68K"
- // CODE resources. The installer checks before installation to see whether
- // or not resource items being installed will be replacing existing resources.
- // If resource items are installed after installation begins, even though we
- // have told the installer to "keepExisting" resource items, it will overwrite
- // them if the resource items did not exist before installation began. Using a
- // ResMerge ( 'inrm' ) atom to handle installation of "PowerMac Warning on 68K"
- // CODE resources will force the "PowerMac Warning on 68K" resource items
- // to be installed before the 68K CODE resources. This is because the
- // 68K CODE resource items are installed via resource atoms ( 'inra' ) ,
- // and in this case the "PowerMac Warning on 68K" CODE resource items are
- // being installed using ResMerge ( 'inrm' ) atoms. ResMerge atoms are always
- // processed before resource atoms.
- //
- //
- // IMPORTANT: It is necessary to place the "PowerMac Warn on 68K"
- // portion file on the first installation disk so that it is assured that
- // the "PowerMac Warn on 68K" portion is processed before the "68K" portion.
- // This is only necessary for the case where the target application does not
- // already exist, but we have no way of knowing whether this condition will
- // exist or not at the time that the installation script is written.
- //
- // Because we must take different approaches ( depending on whether or not
- // the target application already exists ) to installing the PowerMac
- // portion of the application under Custom Install, we must load different
- // packages into the list that the user can select from in Custom Install.
- // Each package provides installation of the Fat Application, with subpackages
- // allowing the user to select either the 68K only version, the PowerMac only
- // version, or both. The difference between the Custom Install packages is
- // whether ResMerge ( 'inrm' ) or resource atoms ( 'inra' ) were used to install
- // the "PowerMac Warning on 68K" CODE resources.
- //
- //
- // When installing the PowerMac CODE that is stored in the data fork, it is
- // necessary to use a file atom ( 'infa' ) to copy over the data fork into
- // the target application. Note that the file atom we use specifies that
- // the resource fork will not be replaced in the existing target application,
- // if any, through the setting of the flag 'noRsrcFork'.
- //
- //
- // When installing the "Common Part", it's okay to always overwrite the existing
- // resource items. This allows us to use the resource merge atom ( 'inrm' ).
- // Resource merge atoms take all the resource items from the resource fork of
- // the source file and "merge" those resources into the resource fork of a
- // new or existing target file. Resource merge atoms do not, however, allow
- // specification of flags to control installation. Resource merge atoms
- // always overwrite resource items that have the same resource type and ID.
- //
- //
- //
- // Layout and description of files contained within this example folder :
- //
- // Main folder :
- //
- // Install Fat App.r - source script ( .r ) for installation
- //
- // Makefile - MPW script that creates finished install
- // script from the source script ( .r )
- //
- // Install Fat App - finished installation script
- //
- // Install Fat App w/ Debugger - finished installation script containing
- // debugger information
- //
- // Wasabi Debugger Log File - text file containing results from last
- // installation run with debugger
- //
- // CheckIfInternalRuleFunc - code resource that is called within
- // install script during installation
- // to check if selected target volume
- // is internal hard disk ( building of
- // this code resource is automated
- // within the Makefile )
- //
- // CheckIfInternalRuleFunc.SYM - symbols file used for running
- // code resource in SADE debugger
- //
- // CheckIfInternalRuleFunc.c.o - object file created by compiling
- // CheckIfInternalRuleFunc.c
- //
- // CheckIfInternalRuleFunc.c - source file used to create
- // compiled code resource
- //
- //
- // ModApp Parts :
- //
- // 68K Macintosh Part - 68K specific portion of application
- //
- // Power Macintosh Part - PowerMac specific portion of application
- //
- // Common Part - portion necessary for either machine type
- //
- // NOTE on ModApp Parts - these files are not automatically created by the
- // makefile for 'Install Fat App'. The scriptwriter should prepare similiar
- // modules for their project by taking a finished copy of a Fat Application
- // and copying and pasting the correct resource items into the three files.
- //
- //
- // ModApp.Fat - application that supports either 68K or
- // PowerMac Native Mode. This file is not
- // included in the installation, but is used
- // as the source for the three files listed
- // in 'Source Files'. The various 68K
- // specific parts are cut and copied into
- // '68K Macintosh Part', the PowerMac specific
- // stuff is cut and copied into 'Power Mac part',
- // and everything remaining is copied into
- // 'Common Part'. In addition the two resource
- // items 'CODE' (0) and (1) from 'NotPPC' are
- // copied into 'Power Mac Part'.
- //
- //
- // NotPPC :
- //
- // NotPPC - module containing the two 'CODE' resource
- // items that will provide an alert when the
- // PowerMac only version is launched on 68K.
- //
- // NotPPC ReadMe - explains the NotPPC files and functionality
- //
- // NotPPC.c - source for NotPPC module
- //
- // NotPPC.h - defines for NotPPC.c
- //
- // NotPPC.make - makefile for NotPPC module
- //
- // NotPPC.o - object file for NotPPC module
- //
- // NotPPC.r - resource definitions for NotPPC module
- //
- //
- // NOTE on NotPPC - this module is not automatically created by the makefile
- // that generates the finished installer script. The main reason for this is
- // that the NotPPC module is a standardized method for dealing with the situation
- // where the user attempts to launch a PowerMac application on the 68K platform.
- // Scriptwriters should not need to make any changes to this module. If you wish
- // to make any changes, simply set the current directory for MPW to ':NotPPC:'
- // and run the makefile to build a new version of 'NotPPC' code resource.
- // Be sure to copy the two 'CODE' resources (0) and (1) into the file
- // 'PowerMacWarnOn68K Part' in the 'Source Files' folder.
- //
- //
- // Other Considerations:
- //
- // - it is simpler to split the 68K and PowerMac CODE resources into two
- // different source files, because these CODE resources occupy the same
- // resource type and ID in the installed application.
- //
- // - often times a Fat Application cannot fit onto a single installation
- // disk, and splitting the Fat Application into it's "logical" pieces
- // is a convenient way to split the file
- //
- // - splitting the Fat Application allows us to create a simpler method
- // for creating a variety of target applications, such as 68K only,
- // PowerMac only, and a full Fat Application version.
- //
- // - splitting the Fat Application also allows us to use less space on the
- // installation disks, then would be taken if we included three full and distinct
- // versions on the installation disks.
- //
- //
- //
- // mark young • 08/20/94
- //
- // Copyright 1993-1994, Apple Computer, Inc., All Rights Reserved
- //
-
- /**************************
-
-
- // Easy Install Package List:
-
- • pick the first applicable case
-
- Target already exists as Fat Application:
- - install Full Fat Application ( update )
-
- Target already exists as 68K version on PowerMac:
- - install Full Fat Application ( update )
-
- Target already exists as PowerMac version on 68K:
- - install Full Fat Application ( update )
-
- Target already exists, and target volume is an external drive:
- - install Full Fat Application ( update )
-
- Target volume is an external drive:
- - install Full Fat Application ( install )
-
- Target machine is a 68K:
- - install 68K Application
-
- Target machine is a PowerMac:
- - install PowerMac Application ( update )
-
- Otherwise:
- - display error that "machine must be 68K or PowerMac"
-
- NOTE: This last case ( Otherwise ) is actually not needed since
- the only time it would be evoked is when the machine being installed
- to is not a 68K or PowerMac. But if the user managed to get the installer
- application to launch on a TRS-80, the user would get a cool error message.
-
-
- // Custom Install Package List:
-
- • pick the first applicable case
-
- Target already exists:
-
- - add update full fat app package
-
- // includes the following two subpackages as selectable options
-
- "Demo Application for 68K Macintosh"
- "Demo Application for Power Macintosh" ( update )
-
- Otherwise:
-
- - add install full fat app package
-
- // includes the following two subpackages as selectable options
-
- "Demo Application for 68K Macintosh"
- "Demo Application for Power Macintosh" ( install )
-
-
- **********************************/
-
-
- include "CheckIfInternalRuleFunc";
-
- #include "InstallerTypes.r"
-
- // include the InstaCompOne atom extender stuff
- // making sure not to add their version resource
- // to our installer script
- include ":::InstaCompOne 1.0:InstaCompOneAtomExt.rsrc" NOT 'vers';
-
- #define currentReleaseDate -1470076096
- #define currentVersion 0x01008000
-
-
- /********************* Easy Install Rule resources *****************************/
-
-
- // • Rule function code resource ( 'inrf' )
-
- // This code resource, which must be referenced from within a call by
- // checkRuleFunction{} within a rule clause, returns true if the
- // selected target volume for the installation has a SCSI ID# of 0,
- // otherwise it returns false. This, in effect, is a check to see
- // if the selected target volume is the internal drive of the machine
- // being installed onto.
- #define kCheckIfInternalDriveUFID 9000
-
-
- // • Values for checkGestalt rule clause
-
- #define gestaltSystemType 'sysa' // processor type
- #define gestalt68Ksysa 1 // 68000 designator
- #define gestaltPPCsysa 2 // PowerMac designator
-
- // • assertions
-
- // NOTE: Assertions are simply a technique for eliminating repetitive
- // condition checks, as well as clarifying rule frameworks. Checks
- // are made once and assertions are set. Those assertions are checked
- // later within rule clauses, which then take action based on the
- // conditions found earlier.
-
- // NOTE: Just defining an assertion does not set that assertion. To set an
- // assertion you must call AddAssertion{} from within a rule clause.
-
- #define kUpdatingTargetFile 701
- #define kUpdating68Kpart 702
- #define kUpdatingPowerMacPart 703
- #define kTgtVolIsInternalDrive 704
- #define kTgtVolIsExternalDrive 705
- #define kMachineIsPowerPC 706
-
- // • constants for packages and atoms
-
- #define kInstallFullFatApp 30000 // used for package
- #define kUpdateFullFatApp 30001 // used for package
- #define kOverWrite68KApp 30002 // used for package
- #define kUpdatePowerMacApp 30003 // used for package
- #define kInstallPowerMacApp 30004 // used for package
- #define kDeleteFullApp 30005 // used for package
-
- #define kCommonStuff 30006 // used for package and atoms
- #define k68KStuff 30007 // used for package and atoms
- #define kPowerMacStuff 30008 // used for package
-
- #define kInstallPowMacWarnOn68K 30009 // used for package
- #define kUpdatePowMacWarnOn68K 30010 // used for package
- #define kAddPowerMacTo68KApp 30011 // used for package
-
- #define kPowerMacFileAtom 30012 // used for file atom
- #define kPowerMacRsrcAtom 30013 // used for rsrc atom
-
- // • Rule frameworks
-
- // • Global framework
-
- resource 'infr' (kGlobalFrameworkRsrcID) {
- format0 {{
- // run through all these rule clauses
- pickAll, { 701, 702, 703, 704, 705, 706 },
- }};
- };
-
- // if target file exists, set assertion kUpdatingTargetFile
- resource 'inrl' (701, "Check if target file already exists") {
- format0 {{
- CheckFileRsrcForkExists { 10000 },
- AddAssertion {{ kUpdatingTargetFile }}
- }};
- };
-
- // if 68K version exists, set assertion kUpdating68Kpart
- resource 'inrl' (702, "Check if 68K version already exists") {
- format0 {{
- CheckAllAssertions {{ kUpdatingTargetFile }},
- CheckFileContainsRsrcByID { 10000, 'CODE', 2 },
- AddAssertion {{ kUpdating68Kpart }}
- }};
- };
-
- // if PowerMac version exists, set assertion kUpdatingPowerMacPart
- resource 'inrl' (703, "Check if PowerMac version already exists") {
- format0 {{
- CheckAllAssertions {{ kUpdatingTargetFile }},
- CheckFileContainsRsrcByID { 10000, 'cfrg', 0 },
- AddAssertion {{ kUpdatingPowerMacPart }}
- }};
- };
-
- // if target volume is external drive, set assertion kTgtVolIsInternalDrive
- resource 'inrl' (704, "Check if installing to internal volume") {
- format0 {{
- checkRuleFunction { kCheckIfInternalDriveUFID },
- AddAssertion {{ kTgtVolIsInternalDrive }}
- }};
- };
-
- // if target volume is external drive, set assertion kTgtVolIsExternalDrive
- resource 'inrl' (705, "Check if installing to external volume") {
- format0 {{
- CheckAnyNonAssertion {{ kTgtVolIsInternalDrive }},
- AddAssertion {{ kTgtVolIsExternalDrive }}
- }};
- };
-
-
- // if machine is a PowerPC, set assertion kMachineIsPowerPC
- resource 'inrl' (706, "Check if machine is PowerPC") {
- format0 {{
- checkGestalt {gestaltSystemType, { gestaltPPCsysa } },
- AddAssertion {{ kMachineIsPowerPC }}
- }};
- };
-
-
- // • Easy Install framework
-
- resource 'infr' (kEasyInstallFrameworkRsrcID) {
- format0 {{
- // pick the first true rule clause and
- // add the appropriate package to Easy Install
- pickFirst, { 800, 801, 802, 803, 804, 805, 806, 807 },
- }};
- };
-
- // if target file exists already, and
- // target file supports 68K and PowerMac,
- // add 68K and PowerMac packages and description to Easy Install
- // • this option is for updating an existing target application
- resource 'inrl' (800, "Check if updating FAT") {
- format0 {{
- CheckAllAssertions {{ kUpdating68Kpart, kUpdatingPowerMacPart }},
- addUserDescription {"Click Install button to install\n" },
- addUserDescription {" • Demo Application for Any Macintosh\n"},
- addPackages {{ kUpdateFullFatApp }}
- }};
- };
-
- // if target file exists already, and
- // target file supports 68K but NOT Native Mode, and
- // target system is a PowerMac,
- // add 68K and PowerMac packages and description to Easy Install
- // • this option is for updating an existing target application
- resource 'inrl' (801, "Check if updating 68K version to a PowerMac") {
- format0 {{
- CheckAllAssertions {{ kUpdating68Kpart, kMachineIsPowerPC }},
- addUserDescription {"Click Install button to install\n" },
- addUserDescription {" • Demo Application for Any Macintosh\n"},
- addPackages {{ kUpdateFullFatApp }}
- }};
- };
-
- // if target file exists already, and
- // target file supports Native Mode but NOT 68K, and
- // target system is a 68K,
- // add 68K and PowerMac packages and description to Easy Install
- // • this option is for updating an existing target application
- resource 'inrl' (802, "Check if updating PowerMac version to a 68K") {
- format0 {{
- CheckAllAssertions {{ kUpdatingPowerMacPart }},
- CheckAllNonAssertions {{ kMachineIsPowerPC }},
- addUserDescription {"Click Install button to install\n" },
- addUserDescription {" • Demo Application for Any Macintosh\n" },
- addPackages {{ kUpdateFullFatApp }}
- }};
- };
-
- // if target file exists already, and
- // installation is being performed to an external drive,
- // add 68K and PowerMac packages and description to Easy Install
- // • this option is for updating an existing target application
- resource 'inrl' (803, "Check if installing to an external drive") {
- format0 {{
- CheckAllAssertions {{ kUpdatingTargetFile }},
- CheckAllAssertions {{ kTgtVolIsExternalDrive }},
- addUserDescription {"Click Install button to install\n" },
- addUserDescription {" • Demo Application for Any Macintosh\n" },
- addPackages {{ kUpdateFullFatApp }}
- }};
- };
-
- // if target file does not exist already, and
- // installation is being performed to an external drive,
- // add 68K and PowerMac packages and description to Easy Install
- resource 'inrl' (804, "Check if installing to an external drive") {
- format0 {{
- CheckAllAssertions {{ kTgtVolIsExternalDrive }},
- addUserDescription {"Click Install button to install\n" },
- addUserDescription {" • Demo Application for Any Macintosh\n" },
- addPackages {{ kInstallFullFatApp }}
- }};
- };
-
- // if target machine is a 68K,
- // add full 68K application package and description to Easy Install
- resource 'inrl' (805, "Check if installing to a 68K machine") {
- format0 {{
- CheckAllNonAssertions {{ kMachineIsPowerPC }},
- addUserDescription {"Click Install button to install\n" },
- addUserDescription {" • Demo Application for your 68K Macintosh\n" },
- addPackages {{ kOverWrite68KApp }}
- }};
- };
-
- // if target machine is a PowerMac,
- // add full PowerMac application package and description to Easy Install
- resource 'inrl' (806, "Check if PowerMac machine") {
- format0 {{
- CheckAllAssertions {{ kMachineIsPowerPC }},
- addUserDescription {"Click Install button to install\n" },
- addUserDescription {" • Demo Application for your Power Macintosh\n" },
- addPackages {{ kUpdatePowerMacApp }}
- }};
- };
-
- // if none of the other rule clauses in this set were satisfied
- // • this rule should never fire, but it's there just in case !!
- resource 'inrl' (807, "Otherwise handle as Fat App") {
- format0 {{
- ReportSysError {"Target System must be a 68K or PowerMac "
- "for installation."},
- }};
- };
-
-
- /******************* Custom Install Rule resources ***************************/
-
- // • Custom Install framework
-
- resource 'infr' (kCustomInstallFrameworkRsrcID) {
- format0 {{
- // pick the first true rule clause and
- // add the appropriate package to Custom Install
- pickFirst, { 901, 902 },
- }};
- };
-
- // add package with all items to Custom Install for existing target app
- resource 'inrl' (901, "Add Custom Selection for Existing Target Application") {
- format0 {{
-
- // only do this rule if target app already exists
- CheckAllAssertions {{ kUpdatingTargetFile }},
-
- // contains all three choices for installing app from Custom Install
- // but uses resource atoms ( 'inra' ) to handle installation of the
- // "PowerMac Warning on 68K" CODE resource items ( see intro for info )
- addCustomItems {{ kUpdateFullFatApp }}
-
- }};
- };
-
- // add package with all items to Custom Install for new target app
- resource 'inrl' (902, "Add Custom Selection for New Target Application") {
- format0 {{
-
- // contains all three choices for installing app from Custom Install
- // but uses ResMerge atoms ( 'inrm' ) to handle installation of the
- // "PowerMac Warning on 68K" CODE resource items ( see intro for info )
- addCustomItems {{ kInstallFullFatApp }}
-
- }};
- };
-
- /********************* Packages resources *****************************/
-
- // Package for Demo App as fat app
- // this option is to be used when the target application is already present
- // • this package is one of the two main Custom Install packages
- resource 'inpk' ( kUpdateFullFatApp ) {
- format0 {
- showsOnCustom, removable, dontForceRestart,
- kUpdateFullFatApp, 0, "Demo Application for Any Macintosh ( update )",
- {
- // Delete entire file ( Custom Removal only )
- 'inpk', kDeleteFullApp,
-
- // 68K part ( always overwrite )
- 'inpk', kOverWrite68KApp,
-
- // PowerMac part ( always overwrite )
- 'inpk', kUpdatePowerMacApp,
-
- // NOTE: although the packages for 68K and PowerMac
- // both include the common resources package, the
- // common resources package will only be added once
- // to the list of packages to be installed.
- }
- }
- };
-
- // Package for Demo App as fat app
- // this option is to be used when the target application is not already present
- // • this package is one of the two main Custom Install packages
- resource 'inpk' ( kInstallFullFatApp ) {
- format0 {
- showsOnCustom, removable, dontForceRestart,
- kInstallFullFatApp, 0, "Demo Application for Any Macintosh ( install )",
- {
- // Delete entire file ( Custom Removal only )
- 'inpk', kDeleteFullApp,
-
- // 68K part ( always overwrite )
- 'inpk', kOverWrite68KApp,
-
- // PowerMac part ( always overwrite )
- 'inpk', kInstallPowerMacApp,
-
- // NOTE: although the packages for 68K and PowerMac
- // both include the common resources package, the
- // common resources package will only be added once
- // to the list of packages to be installed.
- }
- }
- };
-
- // Package for Demo App for 68K only via resource atoms
- resource 'inpk' ( kOverWrite68KApp ) {
- format0 {
- showsOnCustom, notRemovable, dontForceRestart,
- kOverWrite68KApp, 0, "Demo Application for 68K Macintosh",
- {
- // Common Resource fork ( always overwrite )
- 'inpk', kCommonStuff,
-
- // 68K Macintosh CODE Resources
- // this option utilizes 'inra' atoms that will always
- // overwrite the target resource items
- 'inpk', k68KStuff,
- }
- }
- };
-
- // Package to Update Demo App for PowerMac
- // this option is to be used when the target application is already present
- resource 'inpk' ( kUpdatePowerMacApp ) {
- format0 {
- showsOnCustom, notRemovable, dontForceRestart,
- kUpdatePowerMacApp, 0, "Demo Application for Power Macintosh",
- {
- // Common resources ( always overwrite )
- 'inpk', kCommonStuff,
-
- // PowerMac Data Fork and resources ( always overwrite )
- 'inpk', kPowerMacStuff,
-
- // PowerMac warning when launched on 68K ( never overwrite )
- 'inpk', kUpdatePowMacWarnOn68K,
- // has to be inra so it doesn't overwrite existing stuff
-
- }
- }
- };
-
- // Package to Install Demo App for PowerMac
- // this option is to be used when the target application is not already present
- resource 'inpk' ( kInstallPowerMacApp ) {
- format0 {
- showsOnCustom, notRemovable, dontForceRestart,
- kUpdatePowerMacApp, 0, "Demo Application for Power Macintosh",
- {
- // Common resources ( always overwrite )
- 'inpk', kCommonStuff,
-
- // PowerMac Data Fork and resources ( always overwrite )
- 'inpk', kPowerMacStuff,
-
- // PowerMac warning when launched on 68K ( never overwrite )
- // has to be inrm so it goes first, at this point we don't know
- // whether both the PowerMac and 68K versions will be installed
- // or if only the PowerMac version is going to be installed. This
- // comes from the design specification that both the 68K and PowerMac
- // only versions will be presented as subpackages of the Fat App
- // under Custom Install.
- 'inpk', kInstallPowMacWarnOn68K,
- }
- }
- };
-
- // Package to add PowerMac version to 68K version
- resource 'inpk' ( kAddPowerMacTo68KApp ) {
- format0 {
- doesntShowOnCustom, removable, dontForceRestart,
- 0, 0, "Package to add PowerMac support to 68K application",
- {
- // Common resources ( always overwrite )
- 'inpk', kCommonStuff,
-
- // PowerMac Data Fork and resources ( always overwrite )
- 'inpk', kPowerMacStuff,
- }
- }
- };
-
- // Sub-Package to DELETE entire app, whether 68K or PowerMac
- resource 'inpk' ( kDeleteFullApp ) {
- format0 {
- doesntShowOnCustom, removable, dontForceRestart,
- 0, 0, "Package to delete the demo app",
- {
- // Delete entire file on Custom Removal
- 'infa', kDeleteFullApp,
- }
- }
- };
-
- // Sub-Package of Common Resources
- resource 'inpk' ( kCommonStuff ) {
- format0 {
- doesntShowOnCustom, notRemovable, dontForceRestart,
- 0, 0, "Sub-Package of Common Resources",
- {
- // Common Resources ( always overwrite )
- 'inrm', kCommonStuff,
- }
- }
- };
-
- // Sub-Package of 68K specific resources
- resource 'inpk' ( k68KStuff ) {
- format0 {
- doesntShowOnCustom, notRemovable, dontForceRestart,
- 0, 0, "Package for 68K Macintosh",
- {
- // 68K Macintosh CODE Resources ( always overwrite )
- 'inra', 500,
- 'inra', 501,
- 'inra', 502
- }
- }
- };
-
- // Sub-Package of PowerMac warning when launched on 68K
- // • this option is to be used when the target application is not already present
- resource 'inpk' ( kInstallPowMacWarnOn68K ) {
- format0 {
- doesntShowOnCustom, notRemovable, dontForceRestart,
- 0, 0, "Package for Power Macintosh warning on 68K",
- {
- 'inrm', 400, // PowerMac Warning stuff
- }
- }
- };
-
- // Sub-Package of PowerMac warning when launched on 68K
- // • this option is to be used when the target application is already present
- resource 'inpk' ( kUpdatePowMacWarnOn68K ) {
- format0 {
- doesntShowOnCustom, notRemovable, dontForceRestart,
- 0, 0, "Package for Power Macintosh warning on 68K",
- {
- 'inra', 600, // PowerMac Warning stuff
- 'inra', 601, // PowerMac Warning stuff
- 'inra', 602, // PowerMac Warning stuff
- 'inra', 603, // PowerMac Warning stuff
- 'inra', 604, // PowerMac Warning stuff
- }
- }
- };
-
- // Sub-Package of PowerMac data fork and PowerMac specific resources
- resource 'inpk' ( kPowerMacStuff ) {
- format0 {
- doesntShowOnCustom, notRemovable, dontForceRestart,
- 0, 0, "Package for Power Macintosh",
- {
- // Power Macintosh Data Fork ( always overwrite )
- 'infa', kPowerMacFileAtom,
-
- // 'cfrg' resource detailing contents of code in data fork
- 'inra', kPowerMacRsrcAtom,
-
- // NOTE: Because we have chosen to specify that the resource
- // fork will not be replaced when installing the kPowerMacStuff
- // file atom ( by setting 'noRsrcFork' in the atom ) we must
- // install the one resource item for 'cfrg' with a seperate
- // resource atom.
- }
- }
- };
-
-
- // package comment for Fat application ( pre-4.0 package comments )
- resource 'icmt' ( kUpdateFullFatApp ) {
- currentReleaseDate, currentVersion, 30000,
- "This contains the Demo Application, which can be run on any Macintosh."
- };
-
- // package comment for Fat application ( pre-4.0 package comments )
- resource 'icmt' ( kInstallFullFatApp ) {
- currentReleaseDate, currentVersion, 30000,
- "This contains the Demo Application, which can be run on any Macintosh."
- };
-
- // package comment for 68K application ( pre-4.0 package comments )
- resource 'icmt' ( kOverWrite68KApp ) {
- currentReleaseDate, currentVersion, 30000,
- "This contains the Demo Application for use on 68K Macintosh."
- };
-
- // package comment for PowerMac application ( pre-4.0 package comments )
- resource 'icmt' ( kUpdatePowerMacApp ) {
- currentReleaseDate, currentVersion, 30000,
- "This contains the Demo Application for use on Power Macintosh."
- };
-
- // just a good old application icon
- // to be included in the package comment resources above
- data 'ICON' (30000) {
- $"0001 0000 0002 8000 0004 4000 0008 2000"
- $"0010 1000 0020 0800 0040 0400 0080 0200"
- $"0100 0100 0200 0080 0400 0040 0800 0020"
- $"1000 0010 2000 0008 4000 3F04 8000 4082"
- $"4000 8041 2001 3022 1001 C814 080E 7F8F"
- $"0402 3007 0201 0007 0100 8007 0080 6007"
- $"0040 1FE7 0020 021F 0010 0407 0008 0800"
- $"0004 1000 0002 2000 0001 4000 0000 8000"
- };
-
-
- /************************** Atoms resources **********************************/
-
-
- // ResMerge Atom to install common resources
- resource 'inrm' ( kCommonStuff ) {
- format0 {
- 0, // Total size of resources
- // ( filled in by ScriptCheck if 0 )
-
- 10000, // Target File Spec
-
- 20001, // Source File Spec
- // Demo App Parts:Common Part
-
- "Installing Common Resources"
- }
- };
-
- // ResMerge Atom to install 68K CODE resources
- resource 'inrm' ( k68KStuff ) {
- format0 {
- 0, // Total size of resources
- // ( filled in by ScriptCheck if 0 )
-
- 10000, // Target File Spec
-
- 20004, // Source File Spec
- // Demo App Parts:68K Part
- ""
- }
- };
-
- // "PowerMac Warn on 68K" resource items
- resource 'inrm' (400) {
- format0 {
- 0, // Total size of resources
- // ( filled in by ScriptCheck if 0 )
-
- 10000, // Target File Spec
-
- 20004, // Source File Spec
- // Demo App Parts:PowerMacWarnOn68K Part
-
- ""
- }
- };
-
- // This File Atom deletes the entire file on removals
- resource 'infa' ( kDeleteFullApp ) {
- format1 {
- deleteWhenRemoving, // make sure atom is included on removal
- dontDeleteWhenInstalling, // ignore atom during installs
- dontCopy, // ignore atom during installs
- dontIgnoreLockedFile, // don't remove a locked file
-
- dontSetFileLocked, // ignored during removals
- useSrcCrDateToCompare, // ignored during removals
- srcNeedExist, // ignored during removals
- rsrcForkInRsrcFork,
- leaveAloneIfNewer, // ignored during removals
- updateExisting, // ignored during removals
- copyIfNewOrUpdate, // ignored during removals
-
- rsrcFork, // remove resource fork
- dataFork, // remove data fork
- 0,
- 0,
- 10000, // target spec for removal
- { 0, 0, 0 }, // no source spec needed for removal
- 0x0,
- 0,
- 0,
- ""
- }
- };
-
-
-
- // Installs PowerMac Native Mode RISC code contained in data fork
- // NOTE: this does NOT overwrite existing resource fork !!
- // • uses InstaCompOne decompression from file archive
- resource 'infa' ( kPowerMacFileAtom ) {
- format1 {
- dontDeleteWhenRemoving,
- dontDeleteWhenInstalling,
- copy,
- dontIgnoreLockedFile,
- dontSetFileLocked,
- useVersProcToCompare,
- srcNeedExist,
- rsrcForkInDataFork, // InstaCompOne file compression
- // always put rsrc's in data fork
- leaveAloneIfNewer,
- updateExisting,
- copyIfNewOrUpdate,
-
- noRsrcFork, // because this flag is set
- // to 'noRsrcFork' this atom
- // will not disturb resource
- // fork of target file
- dataFork,
- 0,
-
- 0x2000+0x0040, // finder attribute flags - when copying
- // a bona fide file, ScriptCheck can set
- // this value. But since we copying
- // the data fork from a file that is not
- // the original application, we must set
- // these Finder attributes manually
-
- 10000, // target spec for install
- { 20005, // source spec for install
- 0,
- 0
- },
- 0x01008000, // version number 1.0
-
- // WARNING: It is probably best
- // to include a 'vers' resource
- // of ID (1) or (2) in the archive
- // file containing the data fork
- // for PowerMac so that version
- // comparison to existing file will
- // be performed correctly. A non-zero
- // value for the version field should
- // not be updated by ScriptCheck, but
- // ScriptCheck 4.0.3 seems to update
- // this field no matter what. Use the
- // 'vers' resource from the Common Part
- // and paste it into the file archive.
- 0,
- 241, // InstaCompOne atom extender ID
-
- "" // atom description
- }
- };
-
-
- // PowerMac 'cfrg' resource item
- resource 'inra' ( kPowerMacRsrcAtom ) {
- format1 {
- dontDeleteWhenRemoving,
- dontDeleteWhenInstalling,
- copy,
- leaveAloneIfNewer,
- noTgtRequired,
- updateExisting,
- copyIfNewOrUpdate,
- ignoreProtection,
- srcNeedExist,
- byID,
- nameNeedNotMatch,
- 0,
- 10000,
- 'cfrg',
- 0,
- 0x0,
- "",
- { 20003, 'cfrg', 0, 0, "" },
- 0x0,
- 0,
- 0,
- ""
- }
- };
-
- // "PowerMac Warn on 68K" resource item
- resource 'inra' (600) {
- format1 {
- dontDeleteWhenRemoving,
- dontDeleteWhenInstalling,
- copy,
- leaveAloneIfNewer,
- noTgtRequired,
- keepExisting,
- copyIfNewOrUpdate,
- ignoreProtection,
- srcNeedExist,
- byID,
- nameNeedNotMatch,
- 0,
- 10000,
- 'CODE',
- 0,
- 0x0,
- "",
- { 20004, 'CODE', 0, 0, "" },
- 0x0,
- 0,
- 0,
- ""
- }
- };
-
- // "PowerMac Warn on 68K" resource item
- resource 'inra' (601) {
- format1 {
- dontDeleteWhenRemoving,
- dontDeleteWhenInstalling,
- copy,
- leaveAloneIfNewer,
- noTgtRequired,
- keepExisting,
- copyIfNewOrUpdate,
- ignoreProtection,
- srcNeedExist,
- byID,
- nameNeedNotMatch,
- 0,
- 10000,
- 'CODE',
- 1,
- 0x0,
- "",
- { 20004, 'CODE', 1, 0, "" },
- 0x0,
- 0,
- 0,
- ""
- }
- };
-
- // "PowerMac Warn on 68K" resource item
- resource 'inra' (602) {
- format1 {
- dontDeleteWhenRemoving,
- dontDeleteWhenInstalling,
- copy,
- leaveAloneIfNewer,
- noTgtRequired,
- keepExisting,
- copyIfNewOrUpdate,
- ignoreProtection,
- srcNeedExist,
- byID,
- nameNeedNotMatch,
- 0,
- 10000,
- 'ALRT',
- 27309,
- 0x0,
- "",
- { 20004, 'ALRT', 27309, 0, "" },
- 0x0,
- 0,
- 0,
- ""
- }
- };
-
- // "PowerMac Warn on 68K" resource item
- resource 'inra' (603) {
- format1 {
- dontDeleteWhenRemoving,
- dontDeleteWhenInstalling,
- copy,
- leaveAloneIfNewer,
- noTgtRequired,
- keepExisting,
- copyIfNewOrUpdate,
- ignoreProtection,
- srcNeedExist,
- byID,
- nameNeedNotMatch,
- 0,
- 10000,
- 'DITL',
- 27309,
- 0x0,
- "",
- { 20004, 'DITL', 27309, 0, "" },
- 0x0,
- 0,
- 0,
- ""
- }
- };
-
- // "PowerMac Warn on 68K" resource item
- resource 'inra' (604) {
- format1 {
- dontDeleteWhenRemoving,
- dontDeleteWhenInstalling,
- copy,
- leaveAloneIfNewer,
- noTgtRequired,
- keepExisting,
- copyIfNewOrUpdate,
- ignoreProtection,
- srcNeedExist,
- byID,
- nameNeedNotMatch,
- 0,
- 10000,
- 'STR ',
- 27309,
- 0x0,
- "",
- { 20004, 'STR ', 27309, 0, "" },
- 0x0,
- 0,
- 0,
- ""
- }
- };
-
- // 68K CODE resource item
- resource 'inra' (500) {
- format1 {
- dontDeleteWhenRemoving,
- deleteWhenInstalling,
- copy,
- leaveAloneIfNewer,
- noTgtRequired,
- updateExisting,
- copyIfNewOrUpdate,
- ignoreProtection,
- srcNeedExist,
- byID,
- nameNeedNotMatch,
- 0,
- 10000,
- 'CODE',
- 0,
- 0x0,
- "",
- { 20002, 'part', 0, 0, "" },
- 0x0,
- 0,
- 241,
- ""
- }
- };
-
- // 68K CODE resource item
- resource 'inra' (501) {
- format1 {
- dontDeleteWhenRemoving,
- deleteWhenInstalling,
- copy,
- leaveAloneIfNewer,
- noTgtRequired,
- updateExisting,
- copyIfNewOrUpdate,
- ignoreProtection,
- srcNeedExist,
- byID,
- nameNeedNotMatch,
- 0,
- 10000,
- 'CODE',
- 1,
- 0x0,
- "",
- { 20002, 'part', 1, 0, "" },
- 0x0,
- 0,
- 241,
- ""
- }
- };
-
- // 68K CODE resource item
- resource 'inra' (502) {
- format1 {
- dontDeleteWhenRemoving,
- deleteWhenInstalling,
- copy,
- leaveAloneIfNewer,
- noTgtRequired,
- updateExisting,
- copyIfNewOrUpdate,
- ignoreProtection,
- srcNeedExist,
- byID,
- nameNeedNotMatch,
- 0,
- 10000,
- 'CODE',
- 2,
- 0x0,
- "",
- { 20002, 'part', 2, 0, "" },
- 0x0,
- 0,
- 241,
- ""
- }
- };
-
-
- /********************* Target File Spec. resources *****************************/
-
- // target spec for all the various incarnations of application
- resource 'intf' (10000) {
- format1 {
- noSearchForFile, // use default search path
- TypeCrNeedNotMatch, // target TYPE,CREATOR need not match
- 'APPL', // target TYPE ( ignored, see above )
- 'moda', // target CREATOR ( ignored, see above )
- 0x2000+0x0040, // finder attribute flags
- 1, // creation date for new file
- 1, // modification date for new file
- 0, // search proc ID ( 'insp' )
-
- "folder-user:ModApp" // path to target file
- // NOTE: The filename contained
- // in the path to target file is
- // used as the filename to extract
- // from an archive when InstaCompOne
- // is called from within a file atom
- // and this 'intf' is used. This same
- // filename must be used when compressing
- // the file into the archive ( makefile ).
- }
- };
-
-
- /********************* Source File Spec. resources *****************************/
-
- resource 'infs' (20001) {
- 'rsrc', 'RSED', 0x1, noSearchForFile, TypeCrMustMatch,
- "Disk 1:Common Part"
- };
-
- // NOTE: The type for resource archives is 'ircp' ( installer resource compression )
- resource 'infs' (20002) {
- 'ircp', 'kakc', 0x1, noSearchForFile, TypeCrMustMatch,
- "Disk 1:68KRsrcArchive"
- };
-
- resource 'infs' (20003) {
- 'rsrc', 'RSED', 0x1, noSearchForFile, TypeCrMustMatch,
- "Disk 1:Power Macintosh Part"
- };
-
- // NOTE: The type for file archives is 'idcp' ( installer data compression )
- resource 'infs' (20005) {
- 'idcp', 'kakc', 0x1, noSearchForFile, TypeCrMustMatch,
- "Disk 1:PowMacFileArchive"
- };
-
- resource 'infs' (20004) {
- 'rsrc', 'RSED', 0x1, noSearchForFile, TypeCrMustMatch,
- "Disk 1:PowerMacWarnOn68K Part"
- };
-
-
-
- resource 'inrf' (kCheckIfInternalDriveUFID) {
- format0 {
- userFunctionType, // code resource type
- 143, // code resource ID
- 0, // refCon
-
- 0, // use installer's heap,
- // instead of a seperate subheap
-
- "This Rule Function returns TRUE if the target volume has SCSI ID = 0."
- }
- };
-
- // The preferenece resource allows that script writer to specify
- // certain attributes of the Installer's interface and actions.
- // This resource is the default if the script writer does not provide one.
- resource 'inpr' (300) {
- format0 {
- useFolderTargetMode, // allow user to select target folder
- dontAllowUserToSetSystemDisk, // we're not installing to system folder
- showSelectedSizeInCustom,
- noSetupFunctionSupplied,
- dontAllowCleanInstall,
- dontAllowServerAsTarget,
- 0,
- 0,
- {
- 301, 311, 301, 311,
- 302, 312, 302, 312
- },
- "Demo Application Folder"
- }
- };
-
-
-
-